In the case that a corrupted system file in an operating system is detected, according to a version number and a patch number of the operating system, an identifier of the system file such as the name of the system file, and version information of the corrupted system file, a corresponding system file is downloaded from a file library to replace the corrupted system file, thus the system file is repaired.